﻿package Chapter05;

public class SimpleDotComTestDrive {
	void test () {
		// SetLocation
		SimpleDotCom company = new SimpleDotCom();
		int [] loc = {4,5,6};
		company.setLocationCells(loc);
		
		// checkYourself
		// 預期的正確答案
		String [] result = {"miss","miss","miss","miss","hit","hit","kill","miss"};
		// 全部正確
		boolean correct_answered = true; 
		for (int i = 0; i < 7; i++) {
			if (company.checkYourself(""+i) != result[i]) {
				correct_answered = false;
			}
		}
		String output = correct_answered ? "passed" : "error";
		System.out.println(output);
	}
}
